package com.hnkywl.sts.action.sys;

import com.hnkywl.sts.service.sys.WebServiceLogQueryService;
import net.ruixin.web.struts2.SimpleActionSupport;
import org.apache.commons.lang3.time.DateUtils;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Date;

/**
 * 接口日志查询
 * User: ccr
 * Date: 13-9-2
 * Time: 上午10:36
 * To change this template use File | Settings | File Templates.
 */
@Namespace("/sys/jkrzcx")
public class WebServiceLogQueryAction extends SimpleActionSupport {
    private WebServiceLogQueryService webServiceLogQueryService;
    private String clazz;
    private String method;
    private String type;
    private String parameterData;
    private String returnData;
    private String exception;
    private Date datetimeStart;
    private Date datetimeEnd;
    private int page;
    private int rows;
    private Long id;
    private String clobName;

    @Action("jkrzcx")
    public String jkrzcx() {
        datetimeStart = DateUtils.addDays(new Date(), -1);
        datetimeEnd = new Date();
        return SUCCESS;
    }

    @Action("logList")
    public void logList() {
        renderJson(webServiceLogQueryService.findLog(clazz, method, type, parameterData, returnData, exception, datetimeStart, datetimeEnd, page, rows));
    }

    @Action("getDetail")
    public void getDetail() {
        renderText(webServiceLogQueryService.findDetail(id, clobName));
    }

    public String getClazz() {
        return clazz;
    }

    public void setClazz(String clazz) {
        this.clazz = clazz;
    }

    public String getMethod() {
        return method;
    }

    public void setMethod(String method) {
        this.method = method;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Date getDatetimeStart() {
        return datetimeStart;
    }

    public void setDatetimeStart(Date datetimeStart) {
        this.datetimeStart = datetimeStart;
    }

    public Date getDatetimeEnd() {
        return datetimeEnd;
    }

    public void setDatetimeEnd(Date datetimeEnd) {
        this.datetimeEnd = datetimeEnd;
    }

    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public int getRows() {
        return rows;
    }

    public void setRows(int rows) {
        this.rows = rows;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getClobName() {
        return clobName;
    }

    public void setClobName(String clobName) {
        this.clobName = clobName;
    }

    public String getParameterData() {
        return parameterData;
    }

    public void setParameterData(String parameterData) {
        this.parameterData = parameterData;
    }

    public String getReturnData() {
        return returnData;
    }

    public void setReturnData(String returnData) {
        this.returnData = returnData;
    }

    public String getException() {
        return exception;
    }

    public void setException(String exception) {
        this.exception = exception;
    }

    @Autowired
    public void setWebServiceLogQueryService(WebServiceLogQueryService webServiceLogQueryService) {
        this.webServiceLogQueryService = webServiceLogQueryService;
    }
}
